#ifndef IDOCUMENT_H
#define IDOCUMENT_H

#include <QtCore/QObject>
#include <QtCore/QMetaType>
#include <QtCore/QSharedPointer>

namespace core
{
class IDocumentData;
class IContainerDocument;
class MimeType;

class IDocument : public QObject
{
    Q_OBJECT

public:
    virtual void setValid(bool valid) = 0;
    virtual bool isValid() const = 0;

    virtual bool isFuture() const = 0;

    virtual bool isLinked() const = 0;
    virtual bool isContainer() const = 0;

    virtual bool isDirty() const = 0;
    virtual QString name() const = 0;

    virtual MimeType mimeType() const = 0;

    virtual QSharedPointer<IContainerDocument> container() const = 0;

    virtual void setDirty(bool dirty = true) = 0;
    virtual void setFuture(bool future = true) = 0;
    virtual void setContainer(
        const QSharedPointer<IContainerDocument>& container) = 0;

    virtual void rename(const QString& name) = 0;

    virtual IDocumentData* data() const = 0;

    virtual ~IDocument() {}

signals:
    void dirtyChanged(bool);
    void nameChanged();
    void containerChanged();
    void validityChanged(bool);
};

} // namespace core

Q_DECLARE_METATYPE(QSharedPointer<core::IDocument>)

#endif
